var do_App = sm("do_App");
var do_Page = sm("do_Page");
var nf = sm("do_Notification");
var hashdata = mm("do_HashData");
var helperOpen = require("helper/open");
var qqHttp = require("helper/http");
var userUrl = require("url/user");
var bankUrl = userUrl.url.bank.detail;

var headerAout = ui("headerAout");
var addheader = headerAout.add("header", "source://view/reuse/header.ui", 0, 0);
var header = ui("header");
//andriod返回键
do_Page.on("back", function() {
	do_App.closePage();
});
// 左上角-返回
var headerLeft = ui(addheader + ".headerLeft");
// 右上角-
var headerRight = ui(addheader + ".headerRight");
headerRight.visible = false;
headerLeft.on("touch", function() {
	do_App.closePage()
});
header.bindData(hashdata);
hashdata.addData({
	"labelTitle" : "我的银行卡",
})
header.refreshData();

// 页面装载完成后，开始初始化工作
var bankId;
do_Page.on("loaded", function() {
	bankId=do_Page.getData().bankId;
	loadPage();
});
var type=1;
var do_Label_accountNo=ui("do_Label_accountNo");
var do_Label_userReal=ui("do_Label_userReal");
var do_Label_bankName=ui("do_Label_bankName");
var do_Label_subbranch = ui("do_Label_subbranch");
var do_ALayout_13=ui("do_ALayout_13");
var do_Label_type = ui("do_Label_type");
function loadPage(){
	qqHttp.post(bankUrl, {"id":bankId}, function(data) {
		if(null!=data.detail){
			do_Label_accountNo.text=data.detail.accountNo;
			do_Label_userReal.text=data.detail.userReal;
			if(data.detail.type==1){
				do_ALayout_13.visible=false;
				do_Label_type.text = "支付宝";
			}else if(data.detail.type==2){
				do_ALayout_13.visible=true;
				do_Label_type.text = "银行卡";
				do_Label_bankName.text=data.detail.bankName;
				do_Label_subbranch.text = data.detail.subbranch;
			}
		}
	})
}





